package com.credit.management.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.credit.management.system.custom.dao.CProjectMapper;
import com.credit.management.system.generator.dao.ProjectMapper;
import com.credit.management.system.jdbc.dao.ProjectDao;
import com.credit.management.system.model.Page;
import com.credit.management.system.model.Project;
import com.credit.management.system.service.IProjectService;

@Service
public class ProjectService implements IProjectService {
	@Autowired
	ProjectMapper projectMapper;
	@Autowired
	CProjectMapper  cprojectMapper;
	@Autowired
	ProjectDao projectDao;	
	/**
	 * 根据ID删除Project
	 */
	@Override
	public int deleteByPrimaryKey(int id) {
		// TODO Auto-generated method stub
		return projectMapper.deleteByPrimaryKey(id);
	}

	/**
	 * 添加project
	 */
	@Override
	public int insert(Project record) {
		
		return projectMapper.insertSelective(record);
	}

	/**
	 * 根据ID查询project
	 */
	@Override
	public Project selectByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return projectMapper.selectByPrimaryKey(id);
	}

	/**
	 * 修改project
	 */
	@Override
	public int updateByPrimaryKeySelective(Project record) {
		// TODO Auto-generated method stub
		return projectMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public Page findPageProject(Page page) {
		// TODO Auto-generated method stub
		return projectDao.findPageProject(page);
	}
	/**
	 * 查询合同中没有的通过的所有项目
	 * @return
	 */
	@Override
	public List<Map<String, Object>> findProjectByState() {
		
		return cprojectMapper.findProjectByState();
	}

}
